﻿//dom加载完毕后需要执行的js
$(document).ready(function () {
    if (self != top) {
        top.window.location = self.window.location;
    }
    setWinHeightAndWidth(); //设置窗口的大小
    $('#td_left').width(120); //左侧设定宽度120
    readhistory(); //读取cookie中的的url
    $("#leftopen").hide(); //打开左栏 提示 隐藏
    $(".lt0").mouseover(function () {//邦系统菜单
        $(this).attr("class", "lt1");
        if ($(this).attr("menu") != undefined && $(this).attr("menu") != "") {
            var menuid = $(this).attr("menu");
            var menuHtml = $("#" + menuid);
            var objmenu = $("#showmenu");
            objmenu.html(menuHtml.html());
            var offset = $(this).offset();
            objmenu.css({ position: "absolute", zIndex: 1000 });
            objmenu.css({ top: offset.top + 8, left: offset.left });
            //objmenu.css({ width: menuHtml.width()+10, height: menuHtml.height()+15 });
            objmenu.mouseout(function () { objmenu.hide(); });
            $(".menu_item").mouseout(function (event) {
                event.stopPropagation();    //  阻止事件冒泡 
            });
            objmenu.mouseover(function () {
                if (objmenu.is(":hidden")) {
                    objmenu.show();
                }
            });
            objmenu.show();
        }
        else {
            $("#showmenu").hide();
        }
    });
    $(".lt0").mouseout(function () {
        $(this).attr("class", "lt0");
    });
    $("#top_table").mouseover(function () {
        $("#showmenu").hide();
    });
    $('#td_left').mouseover(function () {
        $("#showmenu").hide();
    });
    $('#td_main').mouseover(function () {
        $("#showmenu").hide();
    });
    $("#menutip").click(function () {
        window.frames["leftwin"].window.location.reload(true);
    });
    window.onbeforeunload = window_onbeforeunload;
    window.onresize = setWinHeightAndWidth;
});